package com.hymall.controller.wx;

import com.hymall.bean.MarketCategory;
import com.hymall.bean.common.BaseRespVo;
import com.hymall.bean.vo.WxCatagoryDetailVO;
import com.hymall.bean.vo.WxCatagoryIndexVO;
import com.hymall.service.wx.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 长平居士 - rolfcui@outlook.com
 * @description 目录模块
 * @date 2022/7/19 15:28
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    CatalogService catalogService;

    @GetMapping("index")
    public BaseRespVo index() {
        WxCatagoryIndexVO vo = catalogService.query();
        return BaseRespVo.ok(vo);
    }

    @GetMapping("current")
    public BaseRespVo current(Integer id) {
        WxCatagoryDetailVO data = catalogService.current(id);
        return BaseRespVo.ok(data);
    }

}
